﻿using System;
using System.Drawing;
using AjaxControlToolkit;

namespace BikeBouncer.Site
{
	public class AjaxManager
	{
		#region Ajax methods

		public static void SetDefaults_AsyncFileUpload(AsyncFileUpload obj)
		{
			obj.CompleteBackColor = Color.LightGreen;
			obj.ErrorBackColor = Color.LightPink;
			obj.UploadingBackColor = Color.LightGray;
		}

		public static void SetDefaults_AutoCompleteExtender(AutoCompleteExtender obj)
		{
			obj.CompletionInterval = 200;
			obj.CompletionListCssClass = "ComboSuggest";
			obj.CompletionListItemCssClass = "ComboSuggestItem";
			obj.CompletionListHighlightedItemCssClass = "ComboSuggestItemHV";
			obj.CompletionSetCount = 10;
			obj.EnableCaching = true;
			obj.MinimumPrefixLength = 2;
			obj.ServicePath = "/Ajax.asmx";
		}

		public static void SetDefaults_CalendarExtender(CalendarExtender obj)
		{
			obj.Animated = true;
			obj.Format = "dd/MM/yyyy";
			obj.PopupPosition = CalendarPosition.BottomLeft;
			obj.SelectedDate = DateTime.Now;
		}

		public static void SetDefaults_CascadingDropDown(CascadingDropDown obj)
		{
			obj.EmptyValue = String.Empty;
			obj.PromptValue = String.Empty;
			obj.SelectedValue = String.Empty;
			obj.ServicePath = "/Ajax.asmx";
		}
		
		public static void SetDefaults_ModalPopupExtender(ModalPopupExtender obj)
		{
			obj.BackgroundCssClass = "ModalBg";
			obj.DropShadow = true;
			obj.RepositionMode = ModalPopupRepositionMode.RepositionOnWindowResizeAndScroll;
		}

		public static void SetDefaults_TextBoxWatermarkExtender(TextBoxWatermarkExtender obj)
		{
			obj.WatermarkCssClass = "FormText FormWatermark";
		}

		#endregion
	}
}